<?php
/**
*
*
*/
interface Yz_SQL_Adapter_Interface
{

    public function __construct( $dsn, $dbcharset='utf8' );

    /**
     * get the first <single> row as an object of type Yz_Hash
     *  @return Yz_Hash|null
     */
    public function fetch();

    /**
     * get the first value of the first row as a scalar
     *  @return <scalar>|null
     */
    public function fetchScalar();

    /**
     * get the whole result as a Yz_Array of rows, each row is Yz_Hash
     * @return Yz_Array< Yz_Hash >|null
     */
    public function fetchAll();

    /**
     * query, returning affected/found rows
     *  @param string $query
     *  @throws Yz_SQL_Adapter_QueryException | Yz_SQL_Adapter_UniqueException
     *  @return int affected_rows
     */
    public function query( $query );

    /**
     * execute query, returning $this for chainability
     *
     * @param string $query
     * @throws Yz_SQL_Adapter_QueryException | Yz_SQL_Adapter_UniqueException
     * @return $this
     */
    public function execute( $query );

    // prepare ???
}